package p270jp.pxv.android.viewholder;

import android.view.ViewGroup;
import p134ei.AnalyticsAction;
import p210hh.PixivAccountManager;
import p325m0.MutabilityOwnership;
import p521th.FlexibleItemAdapterSolidItem;
import p521th.SolidItemViewHolder;
import p671zc.CompositeDisposable;
import p677zi.PixivImageLoader;

/* compiled from: PopularLiveListInListSolidItem.kt */
/* renamed from: jp.pxv.android.viewholder.PopularLiveListInListSolidItem */
/* loaded from: classes2.dex */
public final class PopularLiveListInListSolidItem extends FlexibleItemAdapterSolidItem {
    public static final int $stable = 8;
    private final CompositeDisposable compositeDisposable = new CompositeDisposable();
    private final int numberOfBaseRowsBeforeDisplaying;
    private final AnalyticsAction openViaAction;
    private final PixivImageLoader pixivImageLoader;

    public PopularLiveListInListSolidItem(int i, AnalyticsAction aVar, PixivImageLoader aVar2) {
        MutabilityOwnership.m3745m(aVar, "openViaAction");
        MutabilityOwnership.m3745m(aVar2, "pixivImageLoader");
        this.numberOfBaseRowsBeforeDisplaying = i;
        this.openViaAction = aVar;
        this.pixivImageLoader = aVar2;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public int getSpanSize() {
        return 2;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public SolidItemViewHolder onCreateViewHolder(ViewGroup viewGroup) {
        MutabilityOwnership.m3745m(viewGroup, "parent");
        PopularLiveListViewHolder createViewHolder = PopularLiveListViewHolder.createViewHolder(viewGroup, this.compositeDisposable, this.openViaAction, this.pixivImageLoader);
        MutabilityOwnership.m3746l(createViewHolder, "createViewHolder(parent,…Action, pixivImageLoader)");
        return createViewHolder;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public void onDetachedFromRecyclerView() {
        super.onDetachedFromRecyclerView();
        this.compositeDisposable.m80f();
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public boolean shouldBeInserted(int i, int i2, int i3, int i4) {
        return i3 == 0 && i4 / 2 == this.numberOfBaseRowsBeforeDisplaying + (PixivAccountManager.m5511e().f16507m ? 1 : 0);
    }
}
